package com.jd.ymcc.feigin;

import com.jd.ymcc.SearchDoc;
import com.jd.ymcc.enums.GlobalErrorCode;
import com.jd.ymcc.result.JSONResult;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class CourseEsFeignFallbackFactory implements FallbackFactory<CourseEsFeign> {
    @Override
    public CourseEsFeign create(Throwable throwable) {
        return new CourseEsFeign() {
            @Override
            public JSONResult saveCourseEs(SearchDoc courseDoc) {
                return JSONResult.error(GlobalErrorCode.ERROR);
            }
        };
    }
}
